<?php

namespace Apps\AppApi\Method;


use Apps\Common\Enum\PayType;
use Apps\Common\Libs\UserCommon;
use Apps\Common\Models\BeautyParlorTag;
use Apps\Common\Models\SysOpenCity;
use Apps\Common\Models\UserBase;
use Apps\Common\Models\UserPushRelation;
use PhalconPlus\Api\Common\HandleApiBase;
use PhalconPlus\Api\Common\IHandleApi;
use Phalcon\Config;

class BaseMethod extends HandleApiBase implements IHandleApi
{ 

    /**
     * 密码加密
     * @param string $pwd
     * @return string
     */
    public function hashPassword($pwd)
    {
        return UserCommon::hashPassword($pwd, $this->getDi());
    }

    /**
     * 正则获取字符串长度
     * @param null $string
     * @return int
     */
    public function utf8_strlen($string = null)
    {
        // 将字符串分解为单元
        preg_match_all("/./us", $string, $match);
        // 返回单元个数
        return count($match[0]);
    }
}